/**
 * 查询动态列表
 * @type {string} GET
 * @param {string} {openId:小程序openId  visitOpenId:访问人openId（浏览别人空间)   pageNo  pageSize }
 */
export function dynamic(data) {
	return new Promise(resolve => {
		uni.$u.http.get("/applet/friends/circle/dynamic", data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 发布/修改动态
 * @type {string} POST 
 * @param {string} { 
	 openId:微信用户id , 
	 id:id主键,content:内容,
	 picture:图片地址,
	 video:视频地址,
	 locationName:位置名称,
	 contentType:内容类型：1-文字、2-图片、3-文字加图片、3-视频,
	 isPrivate:是否私密：0-默认、1-私密 
	 }
 */
export function save(data) {
	return new Promise(resolve => {
		uni.$u.http.post("/applet/friends/circle/save", data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 删除动态
 * @type {string} POST
 * @param {string} { integer :id主键 }
 */
export function remove(data) {
	return new Promise(resolve => {
		uni.$u.http.post("/applet/friends/circle/remove", data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 动态点赞
 * @type {string} POST
 * @param {string} { openId :微信用户id  dynamicId:朋友圈动态id }
 */
export function like(data) {
	return new Promise(resolve => {
		uni.$u.http.post("/applet/friends/circle/like", data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 动态取消点赞
 * @type {string} POST
 * @param {string} { openId :微信用户id  dynamicId:朋友圈动态id }
 */
export function unlike(data) {
	return new Promise(resolve => {
		uni.$u.http.post("/applet/friends/circle/unlike", data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 动态详情
 * @type {string} GET
 * @param {string} { id:id主键 }
 */
export function info(data) {
	return new Promise(resolve => {
		uni.$u.http.get("/applet/friends/circle/info", data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 评论区
 * @type {string} GET
 * @param {string} { id:动态id }
 */
export function commentArea(data) {
	return new Promise(resolve => {
		uni.$u.http.get("/applet/friends/circle/commentArea", data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 发布评论
 * @type {string} POST
 * @param {string} { openId:微信openId,friendsCircleId:朋友圈动态id,parentId:父id, content:评论内容  receiveWeUserId：接收评论用户id }
 */
export function publishComment(data) {
	return new Promise(resolve => {
		uni.$u.http.post("/applet/friends/circle/publishComment", data).then(info => {
			resolve(info.result)
		})
	})
}
/**
 * 删除评论
 * @type {string} POST
 * @param {string} { openId：微信openId，dynamicCommentId：评论id}
 */
export function removeComment(data) {
	return new Promise(resolve => {
		uni.$u.http.post("/applet/friends/circle/removeComment", data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 签到
 * @type {string} POST
 * @param {string} { openId：微信用户openId ，location：签到地点 ，longitude：签到地点经度 ，latitude：签到地点纬度 }
 */
export function checkIn(data) {
	return new Promise(resolve => {
		uni.$u.http.post("/applet/friends/circle/checkIn", data).then(info => {
			console.log('info');
			resolve(info)
		})
	})
}

/**
 * 签到信息
 * @type {string} GET
 * @param {string} { openId:微信用户id,date:签到日期 }
 */
export function checkInInfo(data) {
	return new Promise(resolve => {
		uni.$u.http.get("/applet/friends/circle/checkInInfo", data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 签到信息
 * @type {string} GET
 * @param {string} { openId:微信用户id,date:签到日期 }
 */
export function monthCheckInInfo(data) {
	return new Promise(resolve => {
		uni.$u.http.get("/applet/friends/circle/monthCheckInInfo", data).then(info => {
			resolve(info.result)
		})
	})
}
/**
 * 问卷
 * @type {string} GET
 * @param {string} { openId:微信用户id,date:签到日期 }
 */
export function questionnaireList(data) {
	return new Promise(resolve => {
		uni.$u.http.get("/applet/carousel/questionnaireList", data).then(info => {
			resolve(info.result)
		})
	})
}